package com.lehecai.core.api.message;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by zhangzq on 14-4-11.
 */
public class MessageDetailType extends IntegerBeanLabelItem {

    private static final Logger logger = LoggerFactory.getLogger(MessageDetailType.class.getName());
    private static final long serialVersionUID = -1;
    private static Map<MessageType, List<MessageDetailType>> messageItems = new HashMap<MessageType, List<MessageDetailType>>(64);
    private MessageType messageType;

    protected MessageDetailType(String name, int value, MessageType messageType) {
        super(MessageDetailType.class.getName(), name, value);
        if (messageType != null) {
            this.messageType = messageType;

            List<MessageDetailType> list = messageItems.get(messageType);
            if (list == null) {
                list = new ArrayList<MessageDetailType>();
                list.add(MessageDetailType.ALL);
                messageItems.put(messageType, list);
            }
            list.add(this);
        }
    }

    public static Map<MessageType, List<MessageDetailType>> getMessageItems() {
        return messageItems;
    }

    public static void setMessageItems(Map<MessageType, List<MessageDetailType>> messageItems) {
        MessageDetailType.messageItems = messageItems;
    }

    public MessageType getMessageType() {
        return messageType;
    }

    public void setMessageType(MessageType messageType) {
        this.messageType = messageType;
    }

    public static List<MessageDetailType> getItemsByGoodsClasses(MessageType messageType) {
        return messageItems.get(messageType);
    }

    public static MessageDetailType getItem(int value){
        try {
            return (MessageDetailType) MessageDetailType.getResult(MessageDetailType.class.getName(), value);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return null;
        }
    }
    public static final MessageDetailType ALL = new MessageDetailType("全部", -1, null);
    public static final MessageDetailType MESSAGE_SYSTEM_NOTICE = new MessageDetailType("系统公告", 1, MessageType.MESSAGE_NOTICE);
    public static final MessageDetailType MESSAGE_REMIND_DRAW = new MessageDetailType("中奖提醒", 2 , MessageType.MESSAGE_REMIND );
    public static final MessageDetailType MESSAGE_REMIND_USER = new MessageDetailType("用户资料提醒", 3 , MessageType.MESSAGE_REMIND );
    public static final MessageDetailType MESSAGE_REMIND_FOLLOW = new MessageDetailType("跟单提醒", 4 , MessageType.MESSAGE_REMIND );
    public static final MessageDetailType MESSAGE_REMIND_CASH = new MessageDetailType("钱包动态", 5 , MessageType.MESSAGE_REMIND );
    public static final MessageDetailType MESSAGE_REMIND_COMBOORDER = new MessageDetailType("套餐提醒", 6 , MessageType.MESSAGE_REMIND );
    public static final MessageDetailType MESSAGE_REMIND_CHASE = new MessageDetailType("追号提醒", 7 , MessageType.MESSAGE_REMIND );
    public static final MessageDetailType MESSAGE_REMIND_PROP = new MessageDetailType("道具", 47 , MessageType.MESSAGE_REMIND );

    public static final MessageDetailType MESSAGE_SUBSCRIBE_SSQ = new MessageDetailType("双色球", 8 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_DLT = new MessageDetailType("大乐透", 9 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_FC3D = new MessageDetailType("福彩3D", 10 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_QXC = new MessageDetailType("七星彩", 11 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_PL3 = new MessageDetailType("排列3", 12 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_PL5 = new MessageDetailType("排列5", 13 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_HD15X5 = new MessageDetailType("华东15选5", 14 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_QCL = new MessageDetailType("七乐彩", 15 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_DF6J1 = new MessageDetailType("东方6加1", 16 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_CQSSC = new MessageDetailType("时时彩", 17 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JXSSC = new MessageDetailType("新时时彩", 18 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_SDQYH = new MessageDetailType("山东群英会", 19 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JX11X5 = new MessageDetailType("11选5", 20 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_SD11X5 = new MessageDetailType("老11选5", 21 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_GD11X5 = new MessageDetailType("新11选5", 22 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_SH11X5 = new MessageDetailType("沪11选5", 23 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_CQ11X5 = new MessageDetailType("乐11选5", 24 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_SDKLPK3 = new MessageDetailType("快乐扑克3", 25 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_GDKL10 = new MessageDetailType("广东快乐10分", 26 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_CQKL10 = new MessageDetailType("幸运农场", 27 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_AHK3 = new MessageDetailType("安徽乐快3", 28 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JSK3 = new MessageDetailType("老快3", 29 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JLK3 = new MessageDetailType("吉林新快3", 30 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_GXK3 = new MessageDetailType("快3", 31 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_ZQDC = new MessageDetailType("北京单场", 32 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JCLQ = new MessageDetailType("竞彩篮球", 33 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JCZQ = new MessageDetailType("竞彩足球", 34 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_SFP = new MessageDetailType("胜负彩", 35 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_NEWS = new MessageDetailType("新闻", 41 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_ACTIVITIES = new MessageDetailType("活动", 42 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_INFORMATION = new MessageDetailType("资讯", 43 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_HNXYSC = new MessageDetailType("幸运赛车", 44 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_JCGJJC = new MessageDetailType("竞彩冠军竞猜", 45 , MessageType.MESSAGE_SUBSCRIBE);
    public static final MessageDetailType MESSAGE_SUBSCRIBE_GZGDHM = new MessageDetailType("关注跟单合买", 46 , MessageType.MESSAGE_SUBSCRIBE);

}
